package org.lionsoul.websnail.downloader;

import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.impl.client.HttpClientBuilder;

/**
 * HttpClient 请求处理器
 *
 * @author yangjian
 **/
public interface HttpClientProcessor
{
    /**
     * HttpClientBuilder 设置接口
     * 可以在创建 HttpClient 对象之前对 Builder 进行配置，比如设置代理，注入 Cookie 等
     */
    void initialize(HttpClientBuilder httpClientBuilder);

    /**
     * 在执行 Http 请求之前，可以对 HttpRequest 对象进行配置，比如添加头信息
     */
    void beforeProcess(HttpRequestBase request);
}
